<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="vue">
    <span style="color: blueviolet">{{info}}/{{userName}}</span>
    <span>身份证：</span>
    <span><input type="text" v-model="cardId"></span>
    <span><input type="button" value="提交Get" @click="CardIdGet" ></span>
    <span><input type="button" value="提交Post" @click="cardIdPost"></span><br>
    <span style="font-size: 40px">{{cardId}}</span>
</div>
<script>
    new Vue({
        'el':'#vue',
        data(){
            return{
                info:"<a></a>",
                userName:'',
                cardId:'',
                url:'http://127.0.0.1:8000/'
            }
        },
        mounted(){
            this.userName="龙傲天"
        },
        methods:{
            CardIdGet(){
                let urlGet=this.url+"carIdGet/"+this.cardId;
                axios.get(urlGet).then(
                    r=>{
                        let result=r.data;
                        console.log(result)
                    }
                )
            },
            cardIdPost(){
                let fd=new FormData();
                fd.append("cardId",this.cardId)
                axios.post(this.url+"carIdPost",fd).then(
                    r=>{
                        let result=r.data;
                        console.log(result)
                    }
                )
            }
        }
    })
</script>
</body>

</html>